package com.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

//http://localhost:8080/smvcHello2/hello
@Controller
public class HController {

    @RequestMapping("/hello")
    public String hello(){
        System.out.println("hello springMVC 22");
        return "index";
    }


    @RequestMapping("/hello2")
    public String hello2(@RequestParam("msg") String msg){
        System.out.println(msg);
        return "index";
    }

}